package com.example.appkcsj.slice;

import com.example.appkcsj.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.aafwk.content.Operation;
/**import ohos.agp.components.Component;
import ohos.agp.components.Image;*/

public class thirdAbilitySlice extends AbilitySlice  {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_third);
       findComponentById(ResourceTable.Id_image1).setClickedListener(component -> {
           Intent familyintent=new Intent();
           Operation operation=new Intent.OperationBuilder()
                   .withDeviceId("")
                   .withBundleName("com.example.appkcsj")
                   .withAbilityName("com.example.appkcsj.fourthAbility")
                   .build();
           familyintent.setOperation(operation);
           startAbility(familyintent);
       });
        findComponentById(ResourceTable.Id_image2).setClickedListener(component -> {
            Intent familyintent=new Intent();
            Operation operation=new Intent.OperationBuilder()
                    .withDeviceId("")
                    .withBundleName("com.example.appkcsj")
                    .withAbilityName("com.example.appkcsj.seventhAbility")
                    .build();
            familyintent.setOperation(operation);
            startAbility(familyintent);
        });
        findComponentById(ResourceTable.Id_image3).setClickedListener(component -> {
            Intent familyintent=new Intent();
            Operation operation=new Intent.OperationBuilder()
                    .withDeviceId("")
                    .withBundleName("com.example.appkcsj")
                    .withAbilityName("com.example.appkcsj.eighthAbility")
                    .build();
            familyintent.setOperation(operation);
            startAbility(familyintent);
        });
        findComponentById(ResourceTable.Id_image4).setClickedListener(component -> {
            Intent familyintent=new Intent();
            Operation operation=new Intent.OperationBuilder()
                    .withDeviceId("")
                    .withBundleName("com.example.appkcsj")
                    .withAbilityName("com.example.appkcsj.ninthAbility")
                    .build();
            familyintent.setOperation(operation);
            startAbility(familyintent);
        });
        //导航条  编辑
        findComponentById(ResourceTable.Id_image5).setClickedListener(component -> {
            Intent familyintent=new Intent();
            Operation operation=new Intent.OperationBuilder()
                    .withDeviceId("")
                   .withBundleName("com.example.appkcsj")
                  .withAbilityName("com.example.appkcsj.fourthAbility")
                    .build();
            familyintent.setOperation(operation);
            startAbility(familyintent);
        });
        //导航条  book
        findComponentById(ResourceTable.Id_image6).setClickedListener(component -> {
            Intent familyintent=new Intent();
            Operation operation=new Intent.OperationBuilder()
                    .withDeviceId("")
                    .withBundleName("com.example.appkcsj")
                    .withAbilityName("com.example.appkcsj.thirdAbility")
                    .build();
            familyintent.setOperation(operation);
            startAbility(familyintent);
        });
        //导航条  个人中心
        findComponentById(ResourceTable.Id_image7).setClickedListener(component -> {
            Intent familyintent=new Intent();
            Operation operation=new Intent.OperationBuilder()
                    .withDeviceId("")
                    .withBundleName("com.example.appkcsj")
                    .withAbilityName("com.example.appkcsj.gerenzhongxinAbility2")
                    .build();
            familyintent.setOperation(operation);
            startAbility(familyintent);
        });
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }

}
